package com.ltxtiyu.video.api;


import com.alibaba.dubbo.config.annotation.Reference;
import com.ltxtiyu.video.common.DataGridParam;
import com.ltxtiyu.video.service.app.OtherService;
import com.ltxtiyu.video.tool.ParamTool;
import com.ltxtiyu.video.tool.Tool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 关注与其他
 */
@RestController
public class ApiOther {
    @Reference
    OtherService otherService;

    /**
     * 根据关键字搜索周边
     * @param request
     * @return
     */
    @RequestMapping("/place/text")
    public String placeText(HttpServletRequest request){
        Map<String, String> params = ParamTool.requestToParamMap(request);
        return otherService.placeText(params);
    }

    /**
     * 根据经纬度搜索周边
     * @param request
     * @return
     */
    @RequestMapping("/place/around")
    public String placeAround(HttpServletRequest request){
        Map<String, String> params = ParamTool.requestToParamMap(request);
        return otherService.placeAround(params);
    }

    /**
     * 查询所有地区记录
     * @param request
     * @return
     */
    @RequestMapping("/area/list")
    public String listArea(HttpServletRequest request){
        return otherService.listArea();
    }

    /**
     * 收集数据
     * @param request
     * @return
     */
    @RequestMapping("/statistics/collect")
    public String statisticsCollect(HttpServletRequest request){
        Map<String, String> params = ParamTool.requestToParamMap(request);
        return otherService.statisticsCollect(params);
    }


}
